{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "cb6e265a",
   "metadata": {},
   "source": [
    "# Series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "02e846be",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "9b78c1c8",
   "metadata": {},
   "outputs": [],
   "source": [
    "s = pd.Series(\n",
    "data=[100,'a',{'dict1',5}],\n",
    "index = pd.Index([1,2,3],name='my_idx'),\n",
    "dtype = 'object',\n",
    "name = 'my_name')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "2202ecdb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "my_idx\n",
       "1           100\n",
       "2             a\n",
       "3    {5, dict1}\n",
       "Name: my_name, dtype: object"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "15c17b5a",
   "metadata": {},
   "outputs": [],
   "source": [
    "s1 = pd.Series(\n",
    "    data=[67,78,75],\n",
    "index=pd.Index(['数学','语文','英语'],name='学科'))\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "38e0914a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "学科\n",
       "数学    67\n",
       "语文    78\n",
       "英语    75\n",
       "dtype: int64"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "7976d79d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([67, 78, 75], dtype=int64)"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "a3becd76",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['数学', '语文', '英语'], dtype='object', name='学科')"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "889ae5ca",
   "metadata": {},
   "outputs": [],
   "source": [
    "s2 = pd.Series(\n",
    "    data=[67,78,75],)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "ff089ae4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    67\n",
       "1    78\n",
       "2    75\n",
       "dtype: int64"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "44b6ecbd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "67"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef41607b",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "# DataFrame\n",
    "\n",
    "* 具有相同特征和列表数据的集合可以用DataFrame来描述"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "7474776c",
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "data = [\n",
    "    [1, 'a', 1.2],\n",
    "    [2, 'b', 2.2], \n",
    "    [3, 'c', 3.2]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "448a3fdc",
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame(data = data,\n",
    "index = ['row_0','row_1','row_2'],\n",
    "columns=['col_0', 'col_1', 'col_2'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "e9554e0b",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col_0</th>\n",
       "      <th>col_1</th>\n",
       "      <th>col_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>row_0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "      <td>2.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_2</th>\n",
       "      <td>3</td>\n",
       "      <td>c</td>\n",
       "      <td>3.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       col_0 col_1  col_2\n",
       "row_0      1     a    1.2\n",
       "row_1      2     b    2.2\n",
       "row_2      3     c    3.2"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "43ed9a26",
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "data = {\n",
    "    'col_0':[1,2,3],\n",
    "    'col_1':['a','b','c'],\n",
    "    'col_2':[1.2,2.2,3.2]\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "01ec4f9e",
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame(\n",
    "    data=data,\n",
    "    index=['row_0','row_1','row_2'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "16425896",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col_0</th>\n",
       "      <th>col_1</th>\n",
       "      <th>col_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>row_0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "      <td>2.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_2</th>\n",
       "      <td>3</td>\n",
       "      <td>c</td>\n",
       "      <td>3.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       col_0 col_1  col_2\n",
       "row_0      1     a    1.2\n",
       "row_1      2     b    2.2\n",
       "row_2      3     c    3.2"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3eefb7df",
   "metadata": {
    "hidden": true
   },
   "source": [
    "## DataFrame 取值的一般方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "c8559545",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "row_0    1\n",
       "row_1    2\n",
       "row_2    3\n",
       "Name: col_0, dtype: int64"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['col_0']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "e3cef792",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col_0</th>\n",
       "      <th>col_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>row_0</th>\n",
       "      <td>1</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_1</th>\n",
       "      <td>2</td>\n",
       "      <td>2.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_2</th>\n",
       "      <td>3</td>\n",
       "      <td>3.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       col_0  col_2\n",
       "row_0      1    1.2\n",
       "row_1      2    2.2\n",
       "row_2      3    3.2"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['col_0','col_2']]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fdcd7924",
   "metadata": {
    "hidden": true
   },
   "source": [
    "* iloc: 强大的切片取值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "3b0bb661",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col_1</th>\n",
       "      <th>col_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>row_1</th>\n",
       "      <td>b</td>\n",
       "      <td>2.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>row_2</th>\n",
       "      <td>c</td>\n",
       "      <td>3.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      col_1  col_2\n",
       "row_1     b    2.2\n",
       "row_2     c    3.2"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[1:3,1:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9bf0291d",
   "metadata": {
    "hidden": true
   },
   "source": [
    "* 课后练习（参考pandas cheat sheet）\n",
    "> 1.iloc  \n",
    "> 2.loc  \n",
    "> 3.iat  \n",
    "> 4.at  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "d9ac43c5",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['row_0', 'row_1', 'row_2'], dtype='object')"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "b4cd2c57",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['col_0', 'col_1', 'col_2'], dtype='object')"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "530b9ad1",
   "metadata": {},
   "source": [
    "# 常用基本函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "8f629a0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('E:\\大二二\\python-data.analysis\\data_analysis-master\\data\\learn_pandas.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "f3d9af25",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Name</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Transfer</th>\n",
       "      <th>Test_Number</th>\n",
       "      <th>Test_Date</th>\n",
       "      <th>Time_Record</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Gaopeng Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/5</td>\n",
       "      <td>0:04:34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Peking University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Changqiang You</td>\n",
       "      <td>Male</td>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/4</td>\n",
       "      <td>0:04:20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>Male</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/12</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/3</td>\n",
       "      <td>0:04:08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Gaojuan You</td>\n",
       "      <td>Male</td>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/17</td>\n",
       "      <td>0:04:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Li Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/22</td>\n",
       "      <td>0:04:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengqiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/5</td>\n",
       "      <td>0:04:48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengmei Shen</td>\n",
       "      <td>Male</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/7</td>\n",
       "      <td>0:04:58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Chunpeng Lv</td>\n",
       "      <td>Male</td>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                            School      Grade            Name  Gender  Height  \\\n",
       "0    Shanghai Jiao Tong University   Freshman    Gaopeng Yang  Female   158.9   \n",
       "1                Peking University   Freshman  Changqiang You    Male   166.5   \n",
       "2    Shanghai Jiao Tong University     Senior         Mei Sun    Male   188.9   \n",
       "3                 Fudan University  Sophomore    Xiaojuan Sun  Female     NaN   \n",
       "4                 Fudan University  Sophomore     Gaojuan You    Male   174.0   \n",
       "..                             ...        ...             ...     ...     ...   \n",
       "195               Fudan University     Junior    Xiaojuan Sun  Female   153.9   \n",
       "196            Tsinghua University     Senior         Li Zhao  Female   160.9   \n",
       "197  Shanghai Jiao Tong University     Senior  Chengqiang Chu  Female   153.9   \n",
       "198  Shanghai Jiao Tong University     Senior   Chengmei Shen    Male   175.3   \n",
       "199            Tsinghua University  Sophomore     Chunpeng Lv    Male   155.7   \n",
       "\n",
       "     Weight Transfer  Test_Number   Test_Date Time_Record  \n",
       "0      46.0        N            1   2019/10/5     0:04:34  \n",
       "1      70.0        N            1    2019/9/4     0:04:20  \n",
       "2      89.0        N            2   2019/9/12     0:05:22  \n",
       "3      41.0        N            2    2020/1/3     0:04:08  \n",
       "4      74.0        N            2   2019/11/6     0:05:22  \n",
       "..      ...      ...          ...         ...         ...  \n",
       "195    46.0        N            2  2019/10/17     0:04:31  \n",
       "196    50.0        N            3   2019/9/22     0:04:03  \n",
       "197    45.0        N            1    2020/1/5     0:04:48  \n",
       "198    71.0        N            2    2020/1/7     0:04:58  \n",
       "199    51.0        N            1   2019/11/6     0:05:05  \n",
       "\n",
       "[200 rows x 10 columns]"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "4da131e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['School', 'Grade', 'Name', 'Gender', 'Height', 'Weight', 'Transfer',\n",
       "       'Test_Number', 'Test_Date', 'Time_Record'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "7f5452e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Gaopeng Yang</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Changqiang You</td>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Gaojuan You</td>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>Li Zhao</td>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Chengqiang Chu</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Chengmei Shen</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>Chunpeng Lv</td>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               Name  Height  Weight\n",
       "0      Gaopeng Yang   158.9    46.0\n",
       "1    Changqiang You   166.5    70.0\n",
       "2           Mei Sun   188.9    89.0\n",
       "3      Xiaojuan Sun     NaN    41.0\n",
       "4       Gaojuan You   174.0    74.0\n",
       "..              ...     ...     ...\n",
       "195    Xiaojuan Sun   153.9    46.0\n",
       "196         Li Zhao   160.9    50.0\n",
       "197  Chengqiang Chu   153.9    45.0\n",
       "198   Chengmei Shen   175.3    71.0\n",
       "199     Chunpeng Lv   155.7    51.0\n",
       "\n",
       "[200 rows x 3 columns]"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['Name','Height','Weight']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "8680564d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Name</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Transfer</th>\n",
       "      <th>Test_Number</th>\n",
       "      <th>Test_Date</th>\n",
       "      <th>Time_Record</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Gaopeng Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/5</td>\n",
       "      <td>0:04:34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Peking University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Changqiang You</td>\n",
       "      <td>Male</td>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/4</td>\n",
       "      <td>0:04:20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>Male</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/12</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/3</td>\n",
       "      <td>0:04:08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Gaojuan You</td>\n",
       "      <td>Male</td>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                          School      Grade            Name  Gender  Height  \\\n",
       "0  Shanghai Jiao Tong University   Freshman    Gaopeng Yang  Female   158.9   \n",
       "1              Peking University   Freshman  Changqiang You    Male   166.5   \n",
       "2  Shanghai Jiao Tong University     Senior         Mei Sun    Male   188.9   \n",
       "3               Fudan University  Sophomore    Xiaojuan Sun  Female     NaN   \n",
       "4               Fudan University  Sophomore     Gaojuan You    Male   174.0   \n",
       "\n",
       "   Weight Transfer  Test_Number  Test_Date Time_Record  \n",
       "0    46.0        N            1  2019/10/5     0:04:34  \n",
       "1    70.0        N            1   2019/9/4     0:04:20  \n",
       "2    89.0        N            2  2019/9/12     0:05:22  \n",
       "3    41.0        N            2   2020/1/3     0:04:08  \n",
       "4    74.0        N            2  2019/11/6     0:05:22  "
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "589a3883",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Name</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Transfer</th>\n",
       "      <th>Test_Number</th>\n",
       "      <th>Test_Date</th>\n",
       "      <th>Time_Record</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/17</td>\n",
       "      <td>0:04:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Li Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/22</td>\n",
       "      <td>0:04:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengqiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/5</td>\n",
       "      <td>0:04:48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengmei Shen</td>\n",
       "      <td>Male</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/7</td>\n",
       "      <td>0:04:58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Chunpeng Lv</td>\n",
       "      <td>Male</td>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            School      Grade            Name  Gender  Height  \\\n",
       "195               Fudan University     Junior    Xiaojuan Sun  Female   153.9   \n",
       "196            Tsinghua University     Senior         Li Zhao  Female   160.9   \n",
       "197  Shanghai Jiao Tong University     Senior  Chengqiang Chu  Female   153.9   \n",
       "198  Shanghai Jiao Tong University     Senior   Chengmei Shen    Male   175.3   \n",
       "199            Tsinghua University  Sophomore     Chunpeng Lv    Male   155.7   \n",
       "\n",
       "     Weight Transfer  Test_Number   Test_Date Time_Record  \n",
       "195    46.0        N            2  2019/10/17     0:04:31  \n",
       "196    50.0        N            3   2019/9/22     0:04:03  \n",
       "197    45.0        N            1    2020/1/5     0:04:48  \n",
       "198    71.0        N            2    2020/1/7     0:04:58  \n",
       "199    51.0        N            1   2019/11/6     0:05:05  "
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "61c9aa38",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 200 entries, 0 to 199\n",
      "Data columns (total 10 columns):\n",
      " #   Column       Non-Null Count  Dtype  \n",
      "---  ------       --------------  -----  \n",
      " 0   School       200 non-null    object \n",
      " 1   Grade        200 non-null    object \n",
      " 2   Name         200 non-null    object \n",
      " 3   Gender       200 non-null    object \n",
      " 4   Height       183 non-null    float64\n",
      " 5   Weight       189 non-null    float64\n",
      " 6   Transfer     188 non-null    object \n",
      " 7   Test_Number  200 non-null    int64  \n",
      " 8   Test_Date    200 non-null    object \n",
      " 9   Time_Record  200 non-null    object \n",
      "dtypes: float64(2), int64(1), object(7)\n",
      "memory usage: 15.8+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "fceea1e8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Test_Number</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>183.000000</td>\n",
       "      <td>189.000000</td>\n",
       "      <td>200.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>163.218033</td>\n",
       "      <td>55.015873</td>\n",
       "      <td>1.645000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>8.608879</td>\n",
       "      <td>12.824294</td>\n",
       "      <td>0.722207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>145.400000</td>\n",
       "      <td>34.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>157.150000</td>\n",
       "      <td>46.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>161.900000</td>\n",
       "      <td>51.000000</td>\n",
       "      <td>1.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>167.500000</td>\n",
       "      <td>65.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>193.900000</td>\n",
       "      <td>89.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Height      Weight  Test_Number\n",
       "count  183.000000  189.000000   200.000000\n",
       "mean   163.218033   55.015873     1.645000\n",
       "std      8.608879   12.824294     0.722207\n",
       "min    145.400000   34.000000     1.000000\n",
       "25%    157.150000   46.000000     1.000000\n",
       "50%    161.900000   51.000000     1.500000\n",
       "75%    167.500000   65.000000     2.000000\n",
       "max    193.900000   89.000000     3.000000"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ce651dc",
   "metadata": {},
   "source": [
    "# 特征统计函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "a067c4c5",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Height  Weight\n",
       "0     158.9    46.0\n",
       "1     166.5    70.0\n",
       "2     188.9    89.0\n",
       "3       NaN    41.0\n",
       "4     174.0    74.0\n",
       "..      ...     ...\n",
       "195   153.9    46.0\n",
       "196   160.9    50.0\n",
       "197   153.9    45.0\n",
       "198   175.3    71.0\n",
       "199   155.7    51.0\n",
       "\n",
       "[200 rows x 2 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_demo = df[['Height','Weight']]\n",
    "df_demo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "2a6c9648",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Height    163.218033\n",
       "Weight     55.015873\n",
       "dtype: float64"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_demo.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "de96261d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Height    193\n",
       "Weight      2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_demo.idxmax()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "23a5401a",
   "metadata": {},
   "source": [
    "# 唯一值函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "7631f8e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Tsinghua University              69\n",
       "Shanghai Jiao Tong University    57\n",
       "Fudan University                 40\n",
       "Peking University                34\n",
       "Name: School, dtype: int64"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['School'].value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e31b81ba",
   "metadata": {},
   "source": [
    "# 实践一\n",
    "* 请计算所有不同学校的身高体重的均均值、最大值、最小值  \n",
    "* 请计算所有不同学校的男女比例情况  \n",
    "* 统计：不同学校的Grade的  数量  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "5f5b770d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Shanghai Jiao Tong University', 'Peking University',\n",
       "       'Fudan University', 'Tsinghua University'], dtype=object)"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['School'].unique()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9b845a0",
   "metadata": {},
   "source": [
    "* query()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "431ea050",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "885f9f6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Name</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Transfer</th>\n",
       "      <th>Test_Number</th>\n",
       "      <th>Test_Date</th>\n",
       "      <th>Time_Record</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Gaopeng Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/5</td>\n",
       "      <td>0:04:34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>Male</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/12</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Qiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>162.5</td>\n",
       "      <td>52.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/12</td>\n",
       "      <td>0:03:53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Xiaopeng Zhou</td>\n",
       "      <td>Male</td>\n",
       "      <td>174.1</td>\n",
       "      <td>74.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/29</td>\n",
       "      <td>0:05:16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Peng You</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/20</td>\n",
       "      <td>0:04:10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Yanfeng Qian</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.1</td>\n",
       "      <td>48.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/19</td>\n",
       "      <td>0:05:29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Qiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>162.4</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/30</td>\n",
       "      <td>0:03:36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Xiaopeng Shen</td>\n",
       "      <td>Male</td>\n",
       "      <td>166.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/2</td>\n",
       "      <td>0:04:54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Changqiang Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>166.1</td>\n",
       "      <td>55.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/29</td>\n",
       "      <td>0:05:01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Qiang Zheng</td>\n",
       "      <td>Male</td>\n",
       "      <td>183.9</td>\n",
       "      <td>87.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/5</td>\n",
       "      <td>0:04:59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Feng Zheng</td>\n",
       "      <td>Female</td>\n",
       "      <td>165.6</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/20</td>\n",
       "      <td>0:05:23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Mei Zhang</td>\n",
       "      <td>Female</td>\n",
       "      <td>156.5</td>\n",
       "      <td>44.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/13</td>\n",
       "      <td>0:04:38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaoli Wang</td>\n",
       "      <td>Male</td>\n",
       "      <td>171.4</td>\n",
       "      <td>70.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/12/20</td>\n",
       "      <td>0:05:12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Qiang Lv</td>\n",
       "      <td>Female</td>\n",
       "      <td>152.1</td>\n",
       "      <td>42.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/3</td>\n",
       "      <td>0:05:21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>159.5</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/22</td>\n",
       "      <td>0:05:20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Yanpeng Lv</td>\n",
       "      <td>Male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>65.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/17</td>\n",
       "      <td>0:04:13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Yanmei Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>167.7</td>\n",
       "      <td>57.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/12/16</td>\n",
       "      <td>0:03:37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Gaoli Xu</td>\n",
       "      <td>Female</td>\n",
       "      <td>164.9</td>\n",
       "      <td>53.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/10/14</td>\n",
       "      <td>0:05:12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Feng Han</td>\n",
       "      <td>Male</td>\n",
       "      <td>183.4</td>\n",
       "      <td>82.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/25</td>\n",
       "      <td>0:05:10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Changmei Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>155.3</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/12/9</td>\n",
       "      <td>0:05:13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Li Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>165.2</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/15</td>\n",
       "      <td>0:04:44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Feng Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>167.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/15</td>\n",
       "      <td>0:03:43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Gaojuan Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>151.5</td>\n",
       "      <td>44.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/22</td>\n",
       "      <td>0:03:46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Feng Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>159.0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/12/13</td>\n",
       "      <td>0:05:17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Mei Chen</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/3</td>\n",
       "      <td>0:04:57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Xiaopeng Lv</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.4</td>\n",
       "      <td>47.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/3</td>\n",
       "      <td>0:05:07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chunpeng Lv</td>\n",
       "      <td>Female</td>\n",
       "      <td>164.1</td>\n",
       "      <td>56.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/9</td>\n",
       "      <td>0:04:28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Xiaopeng Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>161.0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/25</td>\n",
       "      <td>0:05:13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Gaofeng Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>162.8</td>\n",
       "      <td>48.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/26</td>\n",
       "      <td>0:04:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Chunli Zhao</td>\n",
       "      <td>Male</td>\n",
       "      <td>180.2</td>\n",
       "      <td>83.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/7</td>\n",
       "      <td>0:04:33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Peng Zhang</td>\n",
       "      <td>Female</td>\n",
       "      <td>163.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/23</td>\n",
       "      <td>0:04:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Xiaoquan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>154.6</td>\n",
       "      <td>40.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/11/12</td>\n",
       "      <td>0:04:05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Qiang Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/7</td>\n",
       "      <td>0:04:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Qiang Shi</td>\n",
       "      <td>Female</td>\n",
       "      <td>157.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/9</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Chunpeng Shi</td>\n",
       "      <td>Female</td>\n",
       "      <td>152.9</td>\n",
       "      <td>44.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/30</td>\n",
       "      <td>0:04:23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Gaoli Zhao</td>\n",
       "      <td>Male</td>\n",
       "      <td>186.5</td>\n",
       "      <td>83.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/7</td>\n",
       "      <td>0:04:14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>141</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Chunmei Shi</td>\n",
       "      <td>Female</td>\n",
       "      <td>164.9</td>\n",
       "      <td>52.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/8</td>\n",
       "      <td>0:03:33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>143</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaoli Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>145.4</td>\n",
       "      <td>34.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/13</td>\n",
       "      <td>0:03:56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Xiaomei Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>159.3</td>\n",
       "      <td>49.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/17</td>\n",
       "      <td>0:04:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Xiaofeng Qian</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.5</td>\n",
       "      <td>49.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/19</td>\n",
       "      <td>0:05:26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>153</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Changmei Lv</td>\n",
       "      <td>Male</td>\n",
       "      <td>172.2</td>\n",
       "      <td>75.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/6</td>\n",
       "      <td>0:04:15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>155</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Chunmei Han</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.2</td>\n",
       "      <td>44.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/8</td>\n",
       "      <td>0:04:50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Juan Qin</td>\n",
       "      <td>Female</td>\n",
       "      <td>156.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/4</td>\n",
       "      <td>0:04:04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Quan Qian</td>\n",
       "      <td>Female</td>\n",
       "      <td>159.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/26</td>\n",
       "      <td>0:05:26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Qiang Wang</td>\n",
       "      <td>Female</td>\n",
       "      <td>157.5</td>\n",
       "      <td>48.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/12/11</td>\n",
       "      <td>0:04:44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Feng Han</td>\n",
       "      <td>Male</td>\n",
       "      <td>170.1</td>\n",
       "      <td>69.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/24</td>\n",
       "      <td>0:05:19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Xiaopeng Qian</td>\n",
       "      <td>Female</td>\n",
       "      <td>154.3</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/12/28</td>\n",
       "      <td>0:04:02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>167</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Xiaoqiang Feng</td>\n",
       "      <td>Female</td>\n",
       "      <td>157.0</td>\n",
       "      <td>43.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/30</td>\n",
       "      <td>0:03:45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Xiaofeng Zhang</td>\n",
       "      <td>Male</td>\n",
       "      <td>176.4</td>\n",
       "      <td>80.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/25</td>\n",
       "      <td>0:05:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Quan Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.6</td>\n",
       "      <td>53.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/4</td>\n",
       "      <td>0:03:45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaopeng Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>161.9</td>\n",
       "      <td>54.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/4</td>\n",
       "      <td>0:05:09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Qiang Feng</td>\n",
       "      <td>Male</td>\n",
       "      <td>178.9</td>\n",
       "      <td>80.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/12/6</td>\n",
       "      <td>0:04:23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaopeng Shen</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.1</td>\n",
       "      <td>53.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/16</td>\n",
       "      <td>0:03:33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Changli Qin</td>\n",
       "      <td>Male</td>\n",
       "      <td>177.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/21</td>\n",
       "      <td>0:03:57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Gaojuan Wang</td>\n",
       "      <td>Male</td>\n",
       "      <td>166.8</td>\n",
       "      <td>70.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/12/23</td>\n",
       "      <td>0:03:54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengqiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/5</td>\n",
       "      <td>0:04:48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengmei Shen</td>\n",
       "      <td>Male</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/7</td>\n",
       "      <td>0:04:58</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            School      Grade            Name  Gender  Height  \\\n",
       "0    Shanghai Jiao Tong University   Freshman    Gaopeng Yang  Female   158.9   \n",
       "2    Shanghai Jiao Tong University     Senior         Mei Sun    Male   188.9   \n",
       "6    Shanghai Jiao Tong University   Freshman       Qiang Chu  Female   162.5   \n",
       "10   Shanghai Jiao Tong University   Freshman   Xiaopeng Zhou    Male   174.1   \n",
       "12   Shanghai Jiao Tong University     Senior        Peng You  Female     NaN   \n",
       "13   Shanghai Jiao Tong University  Sophomore    Yanfeng Qian  Female   160.1   \n",
       "19   Shanghai Jiao Tong University     Senior       Qiang Chu  Female   162.4   \n",
       "21   Shanghai Jiao Tong University     Senior   Xiaopeng Shen    Male   166.0   \n",
       "22   Shanghai Jiao Tong University     Senior  Changqiang Sun  Female   166.1   \n",
       "23   Shanghai Jiao Tong University     Senior     Qiang Zheng    Male   183.9   \n",
       "31   Shanghai Jiao Tong University     Junior      Feng Zheng  Female   165.6   \n",
       "42   Shanghai Jiao Tong University     Junior       Mei Zhang  Female   156.5   \n",
       "50   Shanghai Jiao Tong University     Junior     Xiaoli Wang    Male   171.4   \n",
       "56   Shanghai Jiao Tong University     Junior        Qiang Lv  Female   152.1   \n",
       "58   Shanghai Jiao Tong University     Junior         Mei Sun  Female   159.5   \n",
       "60   Shanghai Jiao Tong University   Freshman      Yanpeng Lv    Male     NaN   \n",
       "64   Shanghai Jiao Tong University     Junior     Yanmei Yang  Female   167.7   \n",
       "65   Shanghai Jiao Tong University  Sophomore        Gaoli Xu  Female   164.9   \n",
       "71   Shanghai Jiao Tong University  Sophomore        Feng Han    Male   183.4   \n",
       "79   Shanghai Jiao Tong University     Senior    Changmei Sun  Female   155.3   \n",
       "85   Shanghai Jiao Tong University     Junior          Li Chu  Female   165.2   \n",
       "87   Shanghai Jiao Tong University     Senior       Feng Yang  Female   167.0   \n",
       "89   Shanghai Jiao Tong University     Senior    Gaojuan Zhao  Female   151.5   \n",
       "93   Shanghai Jiao Tong University     Junior       Feng Zhao  Female   159.0   \n",
       "103  Shanghai Jiao Tong University     Senior        Mei Chen  Female   153.6   \n",
       "104  Shanghai Jiao Tong University     Senior     Xiaopeng Lv  Female   158.4   \n",
       "109  Shanghai Jiao Tong University     Senior     Chunpeng Lv  Female   164.1   \n",
       "114  Shanghai Jiao Tong University   Freshman   Xiaopeng Zhao  Female   161.0   \n",
       "115  Shanghai Jiao Tong University     Junior     Gaofeng Sun  Female   162.8   \n",
       "117  Shanghai Jiao Tong University   Freshman     Chunli Zhao    Male   180.2   \n",
       "119  Shanghai Jiao Tong University   Freshman      Peng Zhang  Female   163.1   \n",
       "121  Shanghai Jiao Tong University   Freshman    Xiaoquan Sun  Female   154.6   \n",
       "122  Shanghai Jiao Tong University     Junior       Qiang Sun  Female   160.8   \n",
       "123  Shanghai Jiao Tong University     Senior       Qiang Shi  Female   157.7   \n",
       "124  Shanghai Jiao Tong University  Sophomore    Chunpeng Shi  Female   152.9   \n",
       "134  Shanghai Jiao Tong University     Senior      Gaoli Zhao    Male   186.5   \n",
       "141  Shanghai Jiao Tong University   Freshman     Chunmei Shi  Female   164.9   \n",
       "143  Shanghai Jiao Tong University     Junior      Xiaoli Chu  Female   145.4   \n",
       "148  Shanghai Jiao Tong University   Freshman    Xiaomei Yang  Female   159.3   \n",
       "149  Shanghai Jiao Tong University   Freshman   Xiaofeng Qian  Female   158.5   \n",
       "153  Shanghai Jiao Tong University   Freshman     Changmei Lv    Male   172.2   \n",
       "155  Shanghai Jiao Tong University     Junior     Chunmei Han  Female   153.2   \n",
       "156  Shanghai Jiao Tong University     Senior        Juan Qin  Female   156.0   \n",
       "161  Shanghai Jiao Tong University     Senior       Quan Qian  Female   159.0   \n",
       "164  Shanghai Jiao Tong University     Junior      Qiang Wang  Female   157.5   \n",
       "165  Shanghai Jiao Tong University     Senior        Feng Han    Male   170.1   \n",
       "166  Shanghai Jiao Tong University     Senior   Xiaopeng Qian  Female   154.3   \n",
       "167  Shanghai Jiao Tong University  Sophomore  Xiaoqiang Feng  Female   157.0   \n",
       "171  Shanghai Jiao Tong University     Senior  Xiaofeng Zhang    Male   176.4   \n",
       "172  Shanghai Jiao Tong University     Junior       Quan Zhao  Female   160.6   \n",
       "174  Shanghai Jiao Tong University     Junior    Xiaopeng Sun  Female   161.9   \n",
       "184  Shanghai Jiao Tong University   Freshman      Qiang Feng    Male   178.9   \n",
       "188  Shanghai Jiao Tong University     Junior   Xiaopeng Shen  Female   160.1   \n",
       "190  Shanghai Jiao Tong University     Junior     Changli Qin    Male   177.3   \n",
       "192  Shanghai Jiao Tong University     Senior    Gaojuan Wang    Male   166.8   \n",
       "197  Shanghai Jiao Tong University     Senior  Chengqiang Chu  Female   153.9   \n",
       "198  Shanghai Jiao Tong University     Senior   Chengmei Shen    Male   175.3   \n",
       "\n",
       "     Weight Transfer  Test_Number   Test_Date Time_Record  \n",
       "0      46.0        N            1   2019/10/5     0:04:34  \n",
       "2      89.0        N            2   2019/9/12     0:05:22  \n",
       "6      52.0        N            1  2019/12/12     0:03:53  \n",
       "10     74.0        N            1   2019/9/29     0:05:16  \n",
       "12     48.0      NaN            2  2019/10/20     0:04:10  \n",
       "13     48.0        N            2   2019/9/19     0:05:29  \n",
       "19     50.0        N            3   2019/9/30     0:03:36  \n",
       "21     62.0      NaN            1    2020/1/2     0:04:54  \n",
       "22     55.0        N            1  2019/11/29     0:05:01  \n",
       "23     87.0        N            1   2019/12/5     0:04:59  \n",
       "31     51.0        N            1  2019/12/20     0:05:23  \n",
       "42     44.0        N            1   2019/9/13     0:04:38  \n",
       "50     70.0        N            3  2019/12/20     0:05:12  \n",
       "56     42.0        N            2   2019/11/3     0:05:21  \n",
       "58     50.0        N            1  2019/11/22     0:05:20  \n",
       "60     65.0        N            1  2019/11/17     0:04:13  \n",
       "64     57.0        N            2  2019/12/16     0:03:37  \n",
       "65     53.0        N            3  2019/10/14     0:05:12  \n",
       "71     82.0        N            2  2019/10/25     0:05:10  \n",
       "79     46.0        N            3   2019/12/9     0:05:13  \n",
       "85     51.0        N            2  2019/10/15     0:04:44  \n",
       "87     52.0      NaN            2  2019/10/15     0:03:43  \n",
       "89     44.0        N            1  2019/11/22     0:03:46  \n",
       "93     51.0        N            3  2019/12/13     0:05:17  \n",
       "103     NaN        N            2   2019/11/3     0:04:57  \n",
       "104    47.0        N            2   2019/10/3     0:05:07  \n",
       "109    56.0        N            1   2019/10/9     0:04:28  \n",
       "114    53.0        N            3   2019/9/25     0:05:13  \n",
       "115    48.0        N            2  2019/11/26     0:04:22  \n",
       "117    83.0        N            1    2020/1/7     0:04:33  \n",
       "119     NaN        N            3   2019/9/23     0:04:31  \n",
       "121    40.0        N            3  2019/11/12     0:04:05  \n",
       "122     NaN        N            1    2019/9/7     0:04:31  \n",
       "123     NaN      NaN            1   2019/12/9     0:05:22  \n",
       "124    44.0        N            1  2019/11/30     0:04:23  \n",
       "134    83.0        N            1    2019/9/7     0:04:14  \n",
       "141    52.0        N            1    2019/9/8     0:03:33  \n",
       "143    34.0        N            1  2019/11/13     0:03:56  \n",
       "148    49.0        N            1   2019/9/17     0:04:22  \n",
       "149    49.0        N            1  2019/10/19     0:05:26  \n",
       "153    75.0        N            1   2019/10/6     0:04:15  \n",
       "155    44.0        N            2   2019/11/8     0:04:50  \n",
       "156    47.0        N            1    2019/9/4     0:04:04  \n",
       "161    50.0        N            1   2019/9/26     0:05:26  \n",
       "164    48.0        N            3  2019/12/11     0:04:44  \n",
       "165    69.0        N            2   2019/9/24     0:05:19  \n",
       "166    46.0        N            3  2019/12/28     0:04:02  \n",
       "167    43.0        N            2  2019/11/30     0:03:45  \n",
       "171    80.0        N            1  2019/12/25     0:05:03  \n",
       "172    53.0        N            2   2019/10/4     0:03:45  \n",
       "174    54.0        N            2   2019/11/4     0:05:09  \n",
       "184    80.0        N            2   2019/12/6     0:04:23  \n",
       "188    53.0        N            1  2019/10/16     0:03:33  \n",
       "190     NaN        N            1  2019/11/21     0:03:57  \n",
       "192    70.0        N            1  2019/12/23     0:03:54  \n",
       "197    45.0        N            1    2020/1/5     0:04:48  \n",
       "198    71.0        N            2    2020/1/7     0:04:58  "
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query(\"School == 'Shanghai Jiao Tong University'\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eff6279e",
   "metadata": {},
   "source": [
    "# 课后练习（参考pandas cheat sheet）\n",
    "> 1.iloc  \n",
    "> 2.loc  \n",
    "> 3.iat  \n",
    "> 4.at "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d1dbf9f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "c3c9214a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "6392d69a",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('E:\\大二二\\python-data.analysis\\data_analysis-master\\data\\my_csv.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "3b616499",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "      <th>col3</th>\n",
       "      <th>col4</th>\n",
       "      <th>col5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>a</td>\n",
       "      <td>1.4</td>\n",
       "      <td>apple</td>\n",
       "      <td>2020/1/1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>3.4</td>\n",
       "      <td>banana</td>\n",
       "      <td>2020/1/2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6</td>\n",
       "      <td>c</td>\n",
       "      <td>2.5</td>\n",
       "      <td>orange</td>\n",
       "      <td>2020/1/5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>d</td>\n",
       "      <td>3.2</td>\n",
       "      <td>lemon</td>\n",
       "      <td>2020/1/7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2  col3    col4      col5\n",
       "0     2    a   1.4   apple  2020/1/1\n",
       "1     3    b   3.4  banana  2020/1/2\n",
       "2     6    c   2.5  orange  2020/1/5\n",
       "3     5    d   3.2   lemon  2020/1/7"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "653abacf",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## iloc"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4329960f",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "### iloc行操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "39076989",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "col1           5\n",
       "col2           d\n",
       "col3         3.2\n",
       "col4       lemon\n",
       "col5    2020/1/7\n",
       "Name: 3, dtype: object"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "c43fcaa6",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "      <th>col3</th>\n",
       "      <th>col4</th>\n",
       "      <th>col5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>3.4</td>\n",
       "      <td>banana</td>\n",
       "      <td>2020/1/2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6</td>\n",
       "      <td>c</td>\n",
       "      <td>2.5</td>\n",
       "      <td>orange</td>\n",
       "      <td>2020/1/5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2  col3    col4      col5\n",
       "1     3    b   3.4  banana  2020/1/2\n",
       "2     6    c   2.5  orange  2020/1/5"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[1:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b95da58",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "### iloc 列操作\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "68a8e688",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "### iloc 混合操作\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "bd7de345",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col5</th>\n",
       "      <th>col3</th>\n",
       "      <th>col1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2020/1/5</td>\n",
       "      <td>2.5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       col5  col3  col1\n",
       "2  2020/1/5   2.5     6"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[2::3,4::-2].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c5f1488d",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## loc"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0782c8b5",
   "metadata": {
    "heading_collapsed": true,
    "hidden": true
   },
   "source": [
    "### loc行操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "038370ae",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "col1           6\n",
       "col2           c\n",
       "col3         2.5\n",
       "col4      orange\n",
       "col5    2020/1/5\n",
       "Name: 2, dtype: object"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "6bca79f7",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "      <th>col3</th>\n",
       "      <th>col4</th>\n",
       "      <th>col5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>3.4</td>\n",
       "      <td>banana</td>\n",
       "      <td>2020/1/2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>d</td>\n",
       "      <td>3.2</td>\n",
       "      <td>lemon</td>\n",
       "      <td>2020/1/7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2  col3    col4      col5\n",
       "1     3    b   3.4  banana  2020/1/2\n",
       "3     5    d   3.2   lemon  2020/1/7"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[[1,3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "58edd319",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "      <th>col3</th>\n",
       "      <th>col4</th>\n",
       "      <th>col5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>3.4</td>\n",
       "      <td>banana</td>\n",
       "      <td>2020/1/2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6</td>\n",
       "      <td>c</td>\n",
       "      <td>2.5</td>\n",
       "      <td>orange</td>\n",
       "      <td>2020/1/5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>d</td>\n",
       "      <td>3.2</td>\n",
       "      <td>lemon</td>\n",
       "      <td>2020/1/7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2  col3    col4      col5\n",
       "1     3    b   3.4  banana  2020/1/2\n",
       "2     6    c   2.5  orange  2020/1/5\n",
       "3     5    d   3.2   lemon  2020/1/7"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[1:3].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "fc2f7fd2",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col1</th>\n",
       "      <th>col2</th>\n",
       "      <th>col3</th>\n",
       "      <th>col4</th>\n",
       "      <th>col5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>d</td>\n",
       "      <td>3.2</td>\n",
       "      <td>lemon</td>\n",
       "      <td>2020/1/7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>3.4</td>\n",
       "      <td>banana</td>\n",
       "      <td>2020/1/2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col1 col2  col3    col4      col5\n",
       "3     5    d   3.2   lemon  2020/1/7\n",
       "1     3    b   3.4  banana  2020/1/2"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[3::-2].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f008ebc4",
   "metadata": {
    "hidden": true
   },
   "source": [
    "### loc 列操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "51d0d31b",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     apple\n",
       "1    banana\n",
       "2    orange\n",
       "3     lemon\n",
       "Name: col4, dtype: object"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[:,'col4'].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "68fdeb33",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## iat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "e0adf16c",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.5"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iat[2,2]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8d95e3ae",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "## at"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "ba1b16f3",
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'orange'"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.at[2,'col4']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1c2906a7",
   "metadata": {},
   "source": [
    "## 所有不同学校的身高体重的均均值、最大值、最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d4aa6f61",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "012c07ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('E:\\大二二\\python-data.analysis\\data_analysis-master\\data\\learn_pandas.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7794342e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Grade</th>\n",
       "      <th>Name</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Transfer</th>\n",
       "      <th>Test_Number</th>\n",
       "      <th>Test_Date</th>\n",
       "      <th>Time_Record</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Gaopeng Yang</td>\n",
       "      <td>Female</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/10/5</td>\n",
       "      <td>0:04:34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Peking University</td>\n",
       "      <td>Freshman</td>\n",
       "      <td>Changqiang You</td>\n",
       "      <td>Male</td>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/9/4</td>\n",
       "      <td>0:04:20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Mei Sun</td>\n",
       "      <td>Male</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/9/12</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/3</td>\n",
       "      <td>0:04:08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Gaojuan You</td>\n",
       "      <td>Male</td>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>Junior</td>\n",
       "      <td>Xiaojuan Sun</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2019/10/17</td>\n",
       "      <td>0:04:31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Li Zhao</td>\n",
       "      <td>Female</td>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "      <td>N</td>\n",
       "      <td>3</td>\n",
       "      <td>2019/9/22</td>\n",
       "      <td>0:04:03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengqiang Chu</td>\n",
       "      <td>Female</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2020/1/5</td>\n",
       "      <td>0:04:48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>Senior</td>\n",
       "      <td>Chengmei Shen</td>\n",
       "      <td>Male</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "      <td>N</td>\n",
       "      <td>2</td>\n",
       "      <td>2020/1/7</td>\n",
       "      <td>0:04:58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>Sophomore</td>\n",
       "      <td>Chunpeng Lv</td>\n",
       "      <td>Male</td>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "      <td>N</td>\n",
       "      <td>1</td>\n",
       "      <td>2019/11/6</td>\n",
       "      <td>0:05:05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                            School      Grade            Name  Gender  Height  \\\n",
       "0    Shanghai Jiao Tong University   Freshman    Gaopeng Yang  Female   158.9   \n",
       "1                Peking University   Freshman  Changqiang You    Male   166.5   \n",
       "2    Shanghai Jiao Tong University     Senior         Mei Sun    Male   188.9   \n",
       "3                 Fudan University  Sophomore    Xiaojuan Sun  Female     NaN   \n",
       "4                 Fudan University  Sophomore     Gaojuan You    Male   174.0   \n",
       "..                             ...        ...             ...     ...     ...   \n",
       "195               Fudan University     Junior    Xiaojuan Sun  Female   153.9   \n",
       "196            Tsinghua University     Senior         Li Zhao  Female   160.9   \n",
       "197  Shanghai Jiao Tong University     Senior  Chengqiang Chu  Female   153.9   \n",
       "198  Shanghai Jiao Tong University     Senior   Chengmei Shen    Male   175.3   \n",
       "199            Tsinghua University  Sophomore     Chunpeng Lv    Male   155.7   \n",
       "\n",
       "     Weight Transfer  Test_Number   Test_Date Time_Record  \n",
       "0      46.0        N            1   2019/10/5     0:04:34  \n",
       "1      70.0        N            1    2019/9/4     0:04:20  \n",
       "2      89.0        N            2   2019/9/12     0:05:22  \n",
       "3      41.0        N            2    2020/1/3     0:04:08  \n",
       "4      74.0        N            2   2019/11/6     0:05:22  \n",
       "..      ...      ...          ...         ...         ...  \n",
       "195    46.0        N            2  2019/10/17     0:04:31  \n",
       "196    50.0        N            3   2019/9/22     0:04:03  \n",
       "197    45.0        N            1    2020/1/5     0:04:48  \n",
       "198    71.0        N            2    2020/1/7     0:04:58  \n",
       "199    51.0        N            1   2019/11/6     0:05:05  \n",
       "\n",
       "[200 rows x 10 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "3a7df9fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['School', 'Grade', 'Name', 'Gender', 'Height', 'Weight', 'Transfer',\n",
       "       'Test_Number', 'Test_Date', 'Time_Record'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "357eb358",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "4bacad15",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>158.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Peking University</td>\n",
       "      <td>166.5</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>188.9</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>174.0</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>Fudan University</td>\n",
       "      <td>153.9</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>160.9</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>153.9</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>Shanghai Jiao Tong University</td>\n",
       "      <td>175.3</td>\n",
       "      <td>71.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>Tsinghua University</td>\n",
       "      <td>155.7</td>\n",
       "      <td>51.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                            School  Height  Weight\n",
       "0    Shanghai Jiao Tong University   158.9    46.0\n",
       "1                Peking University   166.5    70.0\n",
       "2    Shanghai Jiao Tong University   188.9    89.0\n",
       "3                 Fudan University     NaN    41.0\n",
       "4                 Fudan University   174.0    74.0\n",
       "..                             ...     ...     ...\n",
       "195               Fudan University   153.9    46.0\n",
       "196            Tsinghua University   160.9    50.0\n",
       "197  Shanghai Jiao Tong University   153.9    45.0\n",
       "198  Shanghai Jiao Tong University   175.3    71.0\n",
       "199            Tsinghua University   155.7    51.0\n",
       "\n",
       "[200 rows x 3 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_demo = df[['School','Height','Weight']]\n",
    "df_demo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b94dd595",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'mean' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [13]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmean\u001b[49m(Height)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'mean' is not defined"
     ]
    }
   ],
   "source": [
    "mean(Height)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8104b183",
   "metadata": {},
   "outputs": [],
   "source": [
    "请计算所有不同学校的身高体重的均均值、最大值、最小值\n",
    "请计算所有不同学校的男女比例情况\n",
    "统计：不同学校的Grade的 数量"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "165px"
   },
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
